package com.data.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.data.entity.JsonDataitem;
import com.data.service.DataitemsService;
import com.entity.Meter;
import com.entity.Terminal;
import com.utils.JsonResult;

/**   
* @Title: DataietmController.java 
* @Package com.data.controller 
* @author 孙梦楠 
* @date 2017年8月18日 下午2:43:47 
* @version V1.0.0   
*/
@RestController
@RequestMapping(value = "/data/dataitem")
public class DataitemController {
	
	@Autowired
	private DataitemsService dataitemsservice;
	
	//列表
	@RequestMapping(value = "/meter", method = RequestMethod.POST)
	public JsonResult<List<JsonDataitem>> list_dataitem(@RequestBody Meter meter) {
		
		Integer meterid = meter.getMeterid();
		
		return dataitemsservice.list_dataitem(meterid);
	}
	//列全部结构的表
	@RequestMapping(value = "/terminal", method = RequestMethod.POST)
	public JsonResult<List<JsonDataitem>> list_dataitem_terminal(@RequestBody Terminal terminal) {
		
		Integer terminalid = terminal.getTerminalid();
		
		return dataitemsservice.list_dataitem_terminal(terminalid);
	}

}
